package maze.logic;

public class LogicManager
{
	protected Logic manualLogic = new ManualLogic();
	protected Logic autoLogic = new AutoLogic();
	protected Logic smartLogic = new SmartLogic();

	protected Logic currentLogic = manualLogic;

	protected boolean moving = false;

	protected static LogicManager instance = null;

	public static LogicManager getInstance()
	{
		if (instance == null)
			instance = new LogicManager();
		return instance;
	}

	private LogicManager()
	{
	}

	public void logic()
	{
		currentLogic.logic();
	}

	public void switchMode(Logic logic)
	{
		if (currentLogic != logic)
		{
			// switch to the logic
			currentLogic = logic;
		}

		currentLogic.init();
	}
}
